#pragma once


#include "TunerControl.h"
#include "MetronomeControl.h"



namespace SoundsRight
{
	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;
	using namespace System::Threading;

	//main Display Class
	public __gc class Form1 : public System::Windows::Forms::Form
	{	
			
		private:
			//components of main menu
			System::Windows::Forms::Label *  welcomeLabel_;
			System::Windows::Forms::Button *  goToTunerButton_;
			System::Windows::Forms::Button *  goToMetronomeButton_;
			
			//controllers for different modes
			TunerControl * tunerControl_;
			MetronomeControl * metControl_;

			// Required designer variable.
			System::ComponentModel::Container * components;

			// Required method for Designer support - do not modify
			// the contents of this method with the code editor.
			void InitializeComponent(void)
			{

				System::Resources::ResourceManager *  resources = new System::Resources::ResourceManager(__typeof(SoundsRight::Form1));
				this->welcomeLabel_ = new System::Windows::Forms::Label();
				this->goToTunerButton_ = new System::Windows::Forms::Button();
				this->goToMetronomeButton_ = new System::Windows::Forms::Button();
				this->SuspendLayout();

				tunerControl_ = new TunerControl(this, resources, welcomeLabel_, goToTunerButton_, goToMetronomeButton_);
				metControl_ = new MetronomeControl(this, welcomeLabel_, goToTunerButton_, goToMetronomeButton_);

				// welcomeLabel_
				this->welcomeLabel_->Font = new System::Drawing::Font(S"Viner Hand ITC", 27.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, (System::Byte)0);
				this->welcomeLabel_->Location = System::Drawing::Point(4, 40);
				this->welcomeLabel_->Name = S"welcomeLabel_";
				this->welcomeLabel_->Size = System::Drawing::Size(600, 56);
				this->welcomeLabel_->TabIndex = 0;
				this->welcomeLabel_->Text = S"Welcome to Perfect Pitch Tuner";
				// goToTunerButton_
				this->goToTunerButton_->Font = new System::Drawing::Font(S"Kristen ITC", 15.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, (System::Byte)0);
				this->goToTunerButton_->Location = System::Drawing::Point(152, 152);
				this->goToTunerButton_->Name = S"goToTunerButton_";
				this->goToTunerButton_->Size = System::Drawing::Size(288, 112);
				this->goToTunerButton_->TabIndex = 1;
				this->goToTunerButton_->Text = S"Go To Tuner";
				this->goToTunerButton_->Click += new System::EventHandler(this, loadTuner);
				// goToMetronomeButton_
				this->goToMetronomeButton_->Font = new System::Drawing::Font(S"Kristen ITC", 15.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, (System::Byte)0);
				this->goToMetronomeButton_->Location = System::Drawing::Point(152, 296);
				this->goToMetronomeButton_->Name = S"goToMetronomeButton_";
				this->goToMetronomeButton_->Size = System::Drawing::Size(288, 112);
				this->goToMetronomeButton_->TabIndex = 2;
				this->goToMetronomeButton_->Text = S"Go To Metronome";
				this->goToMetronomeButton_->Click += new System::EventHandler(this, loadMetronome);

				// Form1
				this->AutoScaleBaseSize = System::Drawing::Size(8, 19);
				this->ClientSize = System::Drawing::Size(592, 473);
				this->Controls->Add(this->goToMetronomeButton_);
				this->Controls->Add(this->goToTunerButton_);
				this->Controls->Add(this->welcomeLabel_);
				this->Font = new System::Drawing::Font(S"Arial", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, (System::Byte)0);
				this->MaximizeBox = false;
				this->Name = S"Form1";
				this->Text = S"Tuner";
				this->ResumeLayout(false);
			}	
			
			// hide all main menu components
			void hideMainButtons()
			{
				this->welcomeLabel_->Hide();
				this->goToTunerButton_->Hide();
				this->goToMetronomeButton_->Hide();
			}
			
			//show all main menu components
			void showMainButtons()
			{
				this->welcomeLabel_->Show();
				this->goToTunerButton_->Show();
				this->goToMetronomeButton_->Show();
			}
			
			// load metronome mode
			void loadMetronome(System::Object *  sender, System::EventArgs *  e)
			{
				this->SuspendLayout();
				
				// hide main menu buttons
				hideMainButtons();
				
				// show metronome buttons
				metControl_->showAll();
				
				this->ResumeLayout(false);
			}
			
			// load tuner mode
			void loadTuner(System::Object *  sender, System::EventArgs *  e)
			{
				this->SuspendLayout();
				
				// hide main menu buttons
				hideMainButtons();
				
				//show initial tuner buttons
				tunerControl_->showSelect();
				
				this->ResumeLayout(false);
			}
			
		protected:
			//if disposing, make sure all components are disposed
			void Dispose(Boolean disposing)
			{
				if (disposing && components)
				{
					components->Dispose();
				}
				__super::Dispose(disposing);
			}
			
		public:
			//constructor for Form1
			Form1(void)
			{
				InitializeComponent(); //initialize all buttons/labels/etc
			}
  
	};
}


